<?php
/**
 * 路由映射,会自动映射到当前的路由上面
 */
$tongchenRouteMapper = [
];
$dalinRouteMapper = [
    "login"=>"loginDalin",// 登录，与同城物业的功能不一样，映射到 loginDalin 路由
];
// 环境变量初始化
$variables = new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables();
$variables->bootstrap(app());
$request = Illuminate\Http\Request::capture();
$alias = env("APP_ALIAS");// 别名
switch ($alias){
    case "tc":// 同城物业
        $routeMapper = $tongchenRouteMapper;
        break;
    default:
    case "dl":// 大龄物业
        $routeMapper = $dalinRouteMapper;
        break;
}
$route = $request->decodedPath();
if ($routeMapper[$route]){
    $base = $request->getBasePath();
    $_SERVER['REDIRECT_URL'] = $base.'/'.$routeMapper[$route];
    $_SERVER['REQUEST_URI'] = $base.'/'.$routeMapper[$route].'?'.$request->getQueryString();
}
